package com.example.demo1.controller;
import com.example.demo1.Entity.CourseApplication; // 实体类
import com.example.demo1.service.CourseApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller

public class CourseApplicationController {

    @Autowired
    private CourseApplicationService    courseApplicationService;

    @PostMapping("/CourseApplication")
    public void inputAndSaveCourseApplication(@RequestParam Long teacher_id,
                                              @RequestParam  String teacher_name,
                                              @RequestParam String contact_information,
                                              @RequestParam Long course_id,
                                              @RequestParam String course_name,
                                              @RequestParam Double xue_fen,
                                              @RequestParam Double xue_shi,
                                              @RequestParam String course_information ) {
        CourseApplication courseApplication=courseApplicationService.Allsert(teacher_id,teacher_name,contact_information,course_id,
                course_name,xue_fen,xue_shi,course_information);
        courseApplicationService.save_data(courseApplication);
    }
}